from multiprocessing import Process
from time import sleep


def sub_proc01():
    print("sub process is running!")
    sleep(1)


def sub_proc02(name, age, **kwargs):
    print(f"name is {name}, age is {age}")
    print(f"kwagrs: {kwargs}")
    sleep(1)


if __name__ == "__main__":
    print("main process is running!")
    print("start sub process 01!")
    subp = Process(target=sub_proc01)
    subp.start()
    print("start sub process 02!")
    subp02 = Process(target=sub_proc02, args=("zhangsan", 20), kwargs={"m": 50})
    subp02.start()
    subp02.join()

    print("main process is end!")
